Skip to content

docs(quickstart): fix persistent-storage step + link to merged examples#1205

Open
ericgregory wants to merge 4 commits into
wasmCloud:mainfrom
ericgregory:docs/quickstart-persistent-storage-followups
Open

docs(quickstart): fix persistent-storage step + link to merged examples#1205
ericgregory wants to merge 4 commits into
wasmCloud:mainfrom
ericgregory:docs/quickstart-persistent-storage-followups

Conversation

@ericgregory

@ericgregory ericgregory commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Three quickstart-prose bugs surfaced while building the CI-tested "Add persistent storage" examples (wasmCloud/wasmCloud#5272 and wasmCloud/typescript#668, both merged) that the quickstart walks users through. This catches the docs up to what actually compiles.

⚠️ Depends on wasmCloud/wasmCloud#5278 — that PR drops the redundant export wasi:http/incoming-handler@0.2.2; line from templates/http-hello-world/wit/world.wit (the export is generated by wstd's #[http_server] macro independently of the WIT world). This PR's Rust world.wit code block assumes the post-merge template state. Land #5278 first.

Three issues surfaced while building the working examples (wasmCloud
#5276 and typescript wasmCloud#678) that the quickstart prose walks users
through; this catches the docs up to what actually compiles.

- Rust world.wit: drop `export wasi:http/incoming-handler@0.2.9;`
  with a [!code --] strikethrough marker. wstd's #[http_server] macro
  generates the http export internally; leaving it in world.wit while
  also calling wit_bindgen::generate! makes the component encoder
  fail (the macro and the manual binding generation race over the
  same export symbol). Add a :::note explaining why, since this is
  the kind of detail a first-time user wouldn't infer from the error.

- TS world.wit: revert lingering 0.2.9 → 0.2.6 in the persistent-
  storage section. PR wasmCloud#1204 fixed the earlier code block but missed
  this one; jco-std 0.1.x ships only the 0.2.6 adapter, so anything
  else trips the same ReferenceError already documented in
  bytecodealliance/jco#1245.

- Rust src/lib.rs: `atomics::increment(&bucket, &name, 1)` →
  `atomics::increment(&bucket, name, 1)`. `name` is already `&str`
  from the query parsing; passing `&name` makes it `&&str` and
  clippy's needless_borrow lint (which the wasmCloud workspace
  denies) rejects the build.

Plus, link each language's section to its CI-tested example:

- Rust → wasmCloud/wasmCloud/examples/http-hello-world-persistent-storage
- TS  → wasmCloud/typescript/examples/components/http-hello-world-hono-persistent-storage

The companion examples were added in wasmCloud/wasmCloud#5272 and
wasmCloud/typescript#668 (both merged); the standard `examples`
workflows on those repos rebuild them on every PR, so future drift
between this walkthrough and what actually compiles surfaces in CI.

Signed-off-by: Eric Gregory <eric@cosmonic.com>
@ericgregory ericgregory requested a review from a team as a code owner June 22, 2026 20:39
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for dreamy-golick-5f201e ready!

Name Link
🔨 Latest commit c298984
🔍 Latest deploy log https://app.netlify.com/projects/dreamy-golick-5f201e/deploys/6a3a8f2b10843e0008e1add4
😎 Deploy Preview https://deploy-preview-1205--dreamy-golick-5f201e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ericgregory ericgregory marked this pull request as draft June 22, 2026 20:46
Surfaced while validating the persistent-storage walkthrough end to
end: the not_found function shown in the Rust code block uses
`.unwrap()` (no [!code] markers, so it's meant to be unchanged
context), but the template scaffolds with `.map_err(Into::into)`
and the workspace lints set `unwrap_used = 'deny'`. `wash build`
(cargo build) passes the docs version, but `cargo clippy` rejects
it — and the docs-linked example also uses the .map_err form.

Restoring the .map_err(Into::into) shape so the docs reproduce the
template verbatim. Fixed in both occurrences (lines 74 and 303,
the level-1 and level-2 lib.rs blocks).

Signed-off-by: Eric Gregory <eric@cosmonic.com>
…#5278

Once wasmCloud/wasmCloud#5278 lands, the http-hello-world template no
longer carries the redundant `export wasi:http/incoming-handler@0.2.2;`
line in world.wit (wstd's #[http_server] macro handles it), so users
never see the export and never have to think about removing it. Drop
the [!code --] strikethrough and the :::note explainer from the Rust
world.wit block — the persistent-storage step is now just "add two
import lines."

Also fix a stale link in the TypeScript tip box (was pointing at the
Rust example by mistake).

Signed-off-by: Eric Gregory <eric@cosmonic.com>
@ericgregory ericgregory marked this pull request as ready for review June 22, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant